package com.luaj.elasticsearch.common.model;

import com.luaj.elasticsearch.common.enums.EmBusinessError;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 卢安杰
 * @date 2020-11-20 19:27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CommonError {
    private String errCode;
    private String errMsg;
    public static CommonError error(EmBusinessError error){
        return new CommonError(error.getCode(),error.getMsg());
    }
    public static CommonError error(EmBusinessError error,String msg){
        return new CommonError(error.getCode(),msg);
    }
}
